using System;
using Xoohoo.Configuration;

namespace Xoohoo.Configuration.Extensions
{
    public static class XoohooModuleConfigurationElementExtensions
    {
        public static XoohooModuleConfigurationElement Module(this XoohooModuleConfigurationElementCollection modules, Type moduleType)
        {
            foreach (XoohooModuleConfigurationElement element in modules)
                if (element.Type.StartsWith(moduleType.FullName))
                    return element;

            return null;
        }
    }
}